<!DOCTYPE html>
<html>
<head>
    <title>人机对弈</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="js/global_data.js"></script>
    <!-- Fonts -->
    <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300,400' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900' rel='stylesheet' type='text/css'>
    <!-- CSS Libs -->
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/bootstrap-switch.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/checkbox3.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/jquery.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/dataTables.bootstrap.css">
    <link rel="stylesheet" type="text/css" href="backstage/lib/css/select2.min.css">
    <!-- CSS App -->
    <link rel="stylesheet" type="text/css" href="backstage/css/style.css">
    <link rel="stylesheet" type="text/css" href="backstage/css/themes/flat-blue.css">
    <link rel="stylesheet" type="text/css" href="css/sweet-alert.css">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.min.js"></script>
    <map name="haha" id="haha"></map>
</head>
<canvas id="cas" style="position: absolute;z-index : 0 "></canvas>
<body class="flat-blue" style="overflow-x: hidden;overflow-y: hidden">
<div class="app-container">
    <div class="row content-container">
        <nav class="navbar navbar-default navbar-fixed-top navbar-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-expand-toggle">
                        <i class="fa fa-bars icon"></i>
                    </button>
                    <ol class="breadcrumb navbar-breadcrumb">
                        <li class="active">人机对弈</li>
                    </ol>
                    <button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
                        <i class="fa fa-th icon"></i>
                    </button>
                </div>
                <ul class="nav navbar-nav navbar-right">
                    <button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
                        <i class="fa fa-times icon"></i>
                    </button>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-bell-o"></i></a>
                        <ul class="dropdown-menu animated fadeInDown">
                            <li class="title">
                                系统通知 <span class="badge pull-right">0</span>
                            </li>
                            <li class="message">
                                没有新消息
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown danger">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-users"></i> 4</a>
                        <ul class="dropdown-menu danger  animated fadeInDown">
                            <li class="title">
                                好友列表 <span class="badge pull-right">3</span>
                            </li>
                            <li>
                                <ul class="list-group notifications">
                                    <a href="#">
                                        <li class="list-group-item">
                                            <span class="badge">1</span> <i class="fa fa-mars icon"></i> 吴永康
                                        </li>
                                    </a>
                                    <a href="#">
                                        <li class="list-group-item">
                                            <span class="badge success">1</span> <i class="fa fa-venus icon"></i> 李文俊
                                        </li>
                                    </a>
                                    <a href="#">
                                        <li class="list-group-item">
                                            <span class="badge danger">2</span> <i class="fa fa-comments icon"></i> customers messages
                                        </li>
                                    </a>
                                    <a href="#">
                                        <li class="list-group-item message">
                                            view all
                                        </li>
                                    </a>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown profile">
                        <a href="#" id="LoginOutTitleName" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="caret"></span></a>
                        <ul class="dropdown-menu animated fadeInDown">
                            <li class="profile-img">
                                <img src="backstage/img/profile/picjumbo.com_HNCK4153_resize.jpg" class="profile-img">
                            </li>
                            <li>
                                <div class="profile-info">
                                    <h4 class="username" id="LoginOutName"></h4>
                                    <p id="LoginOutEmail"></p>
                                    <div class="btn-group margin-bottom-2x" role="group">
                                        <button onclick="loginOut()" type="button" class="btn btn-default"><i class="fa fa-sign-out"></i> 登出</button>
                                        <script>
                                            function loginOut() {
                                                localStorage.removeItem("userToken");
                                                window.location="login.html";
                                            }
                                        </script>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
        <div class="side-menu sidebar-inverse">
            <nav class="navbar navbar-default" role="navigation">
                <div class="side-menu-container">
                    <div class="navbar-header">
                        <a class="navbar-brand" href="#">
                            <div class="icon fa fa-cloud"></div>
                            <div class="title">问题反馈</div>
                        </a>
                        <button type="button" class="navbar-expand-toggle pull-right visible-xs">
                            <i class="fa fa-times icon"></i>
                        </button>
                    </div>
                    <ul class="nav navbar-nav">
                        <!-- 被选中的框-->
                        <li>
                            <a href="userMessage.html">
                                <span class="icon fa fa-user"></span><span class="title">个人信息</span>
                            </a>
                        </li>
                        <li>
                            <a href="CodeAndCode.html">
                                <span class="icon fa fa-file-code-o"></span><span class="title">代码对弈</span>
                            </a>
                        </li>

                        <li class="active">
                            <a href="RobotLode.html">
                                <span class="icon fa fa-android"></span><span class="title">人机对弈</span>
                            </a>
                        </li>
                        <!--  提交列表-->
                        <li>
                            <a href="SubmitList.html">
                                <span class="icon fa fa-list"></span><span class="title">提交列表</span>
                            </a>
                        </li>

                        <li>
                            <a href="UserMatch.html">
                                <span class="icon glyphicon glyphicon-stats"></span><span class="title">赛事</span>
                            </a>
                        </li>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </nav>
        </div>



        <!-- Main Content -->
        <div class="container-fluid">
            <img src="backstage/img/robotbackground.jpg" style="height: 100%;width:100%;z-index: -1;position: absolute;">
            <div id="mainArea" class="side-body padding-top">

                <div class="no-margin-bottom row" id="mybody" style="height: 87vh;">
                    <div class="col-lg-3 well" style="top: 30%;font-family: 华文行楷;font-size: 21px;left: 3%;opacity: 0.6" align="center">
                        欢迎来到人机对战，在该模式中，玩家执黑子先行并与目前系统的优胜代码进行对弈。任一方先在棋盘上形成横向、竖向、斜向的连续的相同颜色的五个(含五个以上)棋子的一方获胜。
                    </div>
                    <div class="col-lg-6" style="top: 4%">
                        <div style="color: white;font-family: 华文行楷;font-size: 22px;left: 33%;position: relative">
                            <p style="left: 10%;position: relative">用时</p>
                            <p style="font-size: 26px;left: 5%;position: relative" id="time">00：00：00</p>
                        </div>
                        <div style="width: 450px;height: 450px;position: absolute;left: 9vw;">
                            <img src="backstage/img/qipan.jpg" height="400" width="400" usemap="#haha" style="border-radius: 10px">
                            <div id="mean"><p></p></div>
                        </div>
                    </div>
                    <div class="col-lg-3 well" style="top: 30%;font-family: 华文行楷;font-size: 21px;left: -7%;opacity: 0.6" align="center">
                        五子棋分为无禁手规则与RIF(国际连珠联盟)正式规则，本场对战中采用无禁手规则降低难度，意在使代码对弈的用户在研究算法之余放松身心，并琢磨当前优胜代码的算法思路。
                    </div>

                </div>


            </div>
        </div>


        <script type="text/javascript" src="js/robot.js"></script>
        <!-- Javascript Libs -->
        <script src="js/sweet-alert.js"></script>
        <script type="text/javascript" src="backstage/lib/js/jquery.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/Chart.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/bootstrap-switch.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/jquery.matchHeight-min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/dataTables.bootstrap.min.js"></script>
        <script type="text/javascript" src="backstage/lib/js/ace/ace.js"></script>
        <script type="text/javascript" src="backstage/lib/js/ace/mode-html.js"></script>
        <script type="text/javascript" src="backstage/lib/js/ace/theme-github.js"></script>
        <!-- Javascript -->
        <script type="text/javascript" src="backstage/js/app.js"></script>
        <script type="text/javascript" src="backstage/js/index.js"></script>
    </div>
</div>
</body>
<script>

    $.ajax({
        async: false,
        type: "post",
        url: serverIpAddress+"CodeGame/afterLoadRobot",
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        data: '{"userToken":"'+localStorage.getItem("userToken")+'"}',
        success: function (res) {
            if(res.result === 'false')
                window.location = "RobotLode.html"
        }
    });

    // 判断用户有没有登录信息，没有的话自动登录跳转到登录页面
    let userMessage={};
    $.ajax({
        async: false,
        type: "post",
        data:'{"userToken":"'+localStorage.getItem("userToken")+'"}',
        url: serverIpAddress+"User/LodeUserMessage",
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success:function (data) {
            userMessage = data;
        },
        error:function () {
            window.location="login.html";
        }
    });
    $("#LoginOutTitleName").html(userMessage.name+"<span class=\"caret\"></span>");
    $("#LoginOutName").html(userMessage.name);
    $("#LoginOutEmail").html(userMessage.email);


</script>
</html>

